package com.mrd.gtimp.business.entity;

import com.mrd.annotation.validation.InDeclarationRequiredGroup;
import com.mrd.annotation.validation.MRDLength;
import com.mrd.annotation.validation.MRDRequired;
import com.mrd.annotation.validation.OutDeclarationRequiredGroup;

import org.hibernate.annotations.GenericGenerator;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

/**
 * <p> application name: sample <p> copyright: Copyright@2012 明睿达科技有限公司
 */

/**
 * 报关 商品信息
 *
 * @author winaya
 */
@Entity(name = "T_BIZ_COMMODITY")
public class Commodity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(generator = "paymentableGenerator")
    @GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
    private String id;

    /**
     * 序号
     */
    @MRDLength(max = 5, name = "序号")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "商品序号")
    private String index_num;
    /**
     * 合同商品项目序号
     */
    @MRDLength(max = 3, name = "合同商品项目序号")
//    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "合同商品项目序号")
    @Column(name = "CONTRACT_NUMBER_")
    private String contractNumber;
    /**
     * 商品编码
     */
    @MRDLength(max = 11, name = "商品编码")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "商品编码")
    private String code_t;
    /**
     * 商品名称
     */
    @MRDLength(max = 50, name = "商品名称")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "商品名称")
    private String name;
    /**
     * 规格型号
     */
    @MRDLength(max = 500, name = "规格型号")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "规格型号")
    private String goods_mode;
    /**
     * 计价数量/成交数量
     */
    @MRDLength(max = 10, name = "计价数量/成交数量")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "计价数量/成交数量")
    private String count;
    /**
     * 计价单位/单位
     */
    @MRDLength(max = 10, name = "计价单位/单位")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "计价单位/单位")
    private String unit;
    /**
     * 计价单位代码
     */
    @MRDLength(max = 5, name = "计价单位代码")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "计价单位代码")
    @Column(name = "unit_code_")
    private String unitCode;
    /**
     * 总价/成交总价
     */
    @MRDLength(max = 15, name = "总价/成交总价")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "总价/成交总价")
    private String total_price;
    /**
     * 单价/成交单价
     */
    @MRDLength(max = 20, name = "单价/成交单价")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "单价/成交单价")
    private String unit_price;
    /**
     * 币制
     */
    @MRDLength(max = 20, name = "币制")
    private String currency;
    /**
     * 币制代码
     */
    @MRDLength(max = 20, name = "币制代码")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "币制")
    @Column(name = "currency_code_")
    private String currencyCode;

    /**
     * 法定数量
     */
    @MRDLength(max = 10, name = "法定数量")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "法定数量")
    private String legal_count;
    /**
     * 法定单位
     */
    @MRDLength(max = 10, name = "法定单位")
    private String legal_unit;
    /**
     * 法定单位代码
     */
    @MRDLength(max = 5, name = "法定单位代码")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "法定单位")
    @Column(name = "legal_unit_code_")
    private String legalUnitCode;
    /**
     * 目的地
     */
    @MRDLength(max = 50, name = "目的地")
    private String destination;
    /**
     * 目的地代码
     */
    @MRDLength(max = 20, name = "目的地代码")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "目的地")
    private String destination_code;
    /**
     * 原产国
     */
    @MRDLength(max = 20, name = "原产国")
    private String origin_country;

    /**
     * 原产国代码
     */
    @MRDLength(max = 20, name = "原产国代码")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "原产国")
    private String origin_country_code;
    /**
     * 征免
     */
    @MRDLength(max = 30, name = "征免")
    private String levymode;
    /**
     * 征免代码
     */
    @MRDLength(max = 5, name = "征免代码")
    @MRDRequired(groups = {InDeclarationRequiredGroup.class, OutDeclarationRequiredGroup.class}, name = "征免")
    @Column(name = "levymode_code_")
    private String levyModeCode;
    /**
     * 第二数量
     */
    @MRDLength(max = 10, name = "第二数量")
    private String second_count;
    /**
     * 第二单位
     */
    @MRDLength(max = 10, name = "第二单位")
    private String second_unit;
    /**
     * 第二单位代码
     */
    @MRDLength(max = 5, name = "第二单位代码")
    @Column(name = "second_unit_code_")
    private String secondUnitCode;
    /**
     * 版本号
     */
    @MRDLength(max = 10, name = "版本号")
    private String version_no;
    /**
     * 货号
     */
    @MRDLength(max = 10, name = "货号")
    private String goods_no;
    /**
     * 工缴费
     */
    @MRDLength(max = 10, name = "工缴费")
//    @MRDRequired(groups = OutDeclarationRequiredGroup.class, name = "工缴费")
    private String processing_fee;


    /**
     * 具体包装类型
     */
    @MRDLength(max = 100, name = "具体包装类型")
    @MRDRequired(groups = OutDeclarationRequiredGroup.class, name = "包装种类")
    private String package_type;

    /**
     * 毛重
     */
    @MRDLength(max = 20, name = "毛重")
    @MRDRequired(groups = OutDeclarationRequiredGroup.class, name = "毛重")
    private String goods_gross_weight;

    /**
     * 净重
     */
    @MRDLength(max = 20, name = "净重")
    @MRDRequired(groups = OutDeclarationRequiredGroup.class, name = "净重")
    private String goods_net_weight;

    /**
     * 箱唛
     */
    @MRDLength(max = 500, name = "箱唛")
    @MRDRequired(groups = OutDeclarationRequiredGroup.class, name = "箱唛")
    @Column(name = "BOX_MARK_")
    private String boxMark;

    /**
     * 件数
     */
    @MRDLength(max = 20, name = "件数")
    @MRDRequired(groups = OutDeclarationRequiredGroup.class, name = "包装件数")
    private String goods_number;

    /**
     * 装箱单备注
     */
    @MRDLength(max = 200, name = "装箱单备注")
    @Column(name = "PACKINGLIST_REMARK")
    private String packinglist_remark;


    /**
     * 附加编码(旧)
     */
    @MRDLength(max = 2, name = "附加编码")
    private String code_s;
    /**
     * 备案序号(旧)
     */
    @MRDLength(max = 20, name = "备案序号")
    private String record_id;
    /**
     * 生产厂商(旧)
     */
    @MRDLength(max = 50, name = "生产厂商")
    private String producer;

    /**
     * 手册项号
     */
    @MRDLength(max = 32, name = "手册项号")
    private String handbook_item_no;


    /**
     * 规格（客户手填）
     */
    @MRDLength(max = 100, name = "商品规格")
    private String key_elements;

    /**
     * 相关报关单信息
     */
    @ManyToOne
    @JoinColumn(name = "DECLARATION_ID")
    private Declaration declaration;

    /**
     * 柜号
     */
    @MRDLength(max = 4000, name = "柜号")
    @Column(name = "CONTAINER_NO")
    private String container_no;

    /**
     * 装箱单明细
     */
//    @OneToMany(mappedBy = "commodity")
    @Transient
    private PackingListDetailed packingListDetailed;

    public Declaration getDeclaration() {
        return declaration;
    }

    public void setDeclaration(Declaration declaration) {
        this.declaration = declaration;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode_t() {
        return code_t;
    }

    public void setCode_t(String code_t) {
        this.code_t = code_t;
    }

    public String getGoods_mode() {
        return goods_mode;
    }

    public void setGoods_mode(String goods_mode) {
        this.goods_mode = goods_mode;
    }

    public String getCount() {
        return count;
    }

    public void setCount(String count) {
        this.count = count;
    }

    public String getTotal_price() {
        return total_price;
    }

    public void setTotal_price(String total_price) {
        this.total_price = total_price;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public String getSecond_count() {
        return second_count;
    }

    public void setSecond_count(String second_count) {
        this.second_count = second_count;
    }

    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }

    public String getCode_s() {
        return code_s;
    }

    public void setCode_s(String code_s) {
        this.code_s = code_s;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getUnit_price() {
        return unit_price;
    }

    public void setUnit_price(String unit_price) {
        this.unit_price = unit_price;
    }

    public String getSecond_unit() {
        return second_unit;
    }

    public void setSecond_unit(String second_unit) {
        this.second_unit = second_unit;
    }

    public String getLevymode() {
        return levymode;
    }

    public void setLevymode(String levymode) {
        this.levymode = levymode;
    }

    public String getRecord_id() {
        return record_id;
    }

    public void setRecord_id(String record_id) {
        this.record_id = record_id;
    }

    public String getLegal_count() {
        return legal_count;
    }

    public void setLegal_count(String legal_count) {
        this.legal_count = legal_count;
    }

    public String getLegal_unit() {
        return legal_unit;
    }

    public void setLegal_unit(String legal_unit) {
        this.legal_unit = legal_unit;
    }

    public String getVersion_no() {
        return version_no;
    }

    public void setVersion_no(String version_no) {
        this.version_no = version_no;
    }

    public String getGoods_no() {
        return goods_no;
    }

    public void setGoods_no(String goods_no) {
        this.goods_no = goods_no;
    }

    public String getProducer() {
        return producer;
    }

    public void setProducer(String producer) {
        this.producer = producer;
    }

    public String getProcessing_fee() {
        return processing_fee;
    }

    public void setProcessing_fee(String processing_fee) {
        this.processing_fee = processing_fee;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getHandbook_item_no() {
        return handbook_item_no;
    }

    public void setHandbook_item_no(String handbook_item_no) {
        this.handbook_item_no = handbook_item_no;
    }

    public String getGoods_number() {
        return goods_number;
    }

    public void setGoods_number(String goods_number) {
        this.goods_number = goods_number;
    }

    public String getGoods_net_weight() {
        return goods_net_weight;
    }

    public void setGoods_net_weight(String goods_net_weight) {
        this.goods_net_weight = goods_net_weight;
    }

    public String getGoods_gross_weight() {
        return goods_gross_weight;
    }

    public void setGoods_gross_weight(String goods_gross_weight) {
        this.goods_gross_weight = goods_gross_weight;
    }

    public String getIndex_num() {
        return index_num;
    }

    public void setIndex_num(String index_num) {
        this.index_num = index_num;
    }

    public String getContainer_no() {
        return container_no;
    }

    public void setContainer_no(String container_no) {
        this.container_no = container_no;
    }

    public String getPackinglist_remark() {
        return packinglist_remark;
    }

    public void setPackinglist_remark(String packinglist_remark) {
        this.packinglist_remark = packinglist_remark;
    }

    public String getKey_elements() {
        return key_elements;
    }

    public void setKey_elements(String key_elements) {
        this.key_elements = key_elements;
    }

    public PackingListDetailed getPackingListDetailed() {
        return packingListDetailed;
    }

    public void setPackingListDetailed(PackingListDetailed packingListDetailed) {
        this.packingListDetailed = packingListDetailed;
    }

    public String getPackage_type() {
        return package_type;
    }

    public void setPackage_type(String package_type) {
        this.package_type = package_type;
    }

    public String getDestination_code() {
        return destination_code;
    }

    public void setDestination_code(String destination_code) {
        this.destination_code = destination_code;
    }

    public String getOrigin_country() {
        return origin_country;
    }

    public void setOrigin_country(String origin_country) {
        this.origin_country = origin_country;
    }

    public String getOrigin_country_code() {
        return origin_country_code;
    }

    public void setOrigin_country_code(String origin_country_code) {
        this.origin_country_code = origin_country_code;
    }

    //  -- getter/setter
    public String getContractNumber() {
        return contractNumber;
    }

    public void setContractNumber(String contractNumber) {
        this.contractNumber = contractNumber;
    }

    public String getBoxMark() {
        return boxMark;
    }

    public void setBoxMark(String boxMark) {
        this.boxMark = boxMark;
    }


    public String getCurrencyCode() {
        return currencyCode;
    }

    public void setCurrencyCode(String currencyCode) {
        this.currencyCode = currencyCode;
    }

    public String getUnitCode() {
        return unitCode;
    }

    public void setUnitCode(String unitCode) {
        this.unitCode = unitCode;
    }

    public String getLegalUnitCode() {
        return legalUnitCode;
    }

    public void setLegalUnitCode(String legalUnitCode) {
        this.legalUnitCode = legalUnitCode;
    }

    public String getLevyModeCode() {
        return levyModeCode;
    }

    public void setLevyModeCode(String levyModeCode) {
        this.levyModeCode = levyModeCode;
    }

    public String getSecondUnitCode() {
        return secondUnitCode;
    }

    public void setSecondUnitCode(String secondUnitCode) {
        this.secondUnitCode = secondUnitCode;
    }
}
